const filter = {
    baseSexFil: function(val) {
        if (val == "0") {
            return "女";
        } else if (val == "1") {
            return "男";
        } else {
            return "未知";
        }
    },
    baseServiceTypeFil: function(val) {
        if (val == "0") {
            return "系统派单";
        } else {
            return "指定医生";
        }
    },
    baseOrderStatusFil: function(val) {
        if (val == "3") {
            return "已完成";
        } else if (val == "2") {
            return "待确认";
        } else if (val == "5") {
            return "问诊中";
        }
    },
    stateFil: function(val) {
        if (val == 2) {
            return "开始接单";
        } else {
            return "暂停接单";
        }
    },
    baseTimeFun: function(val) {
        if (val) {
            var standardTime = new Date(Number(val));
            var y, m, d, h, f;
            y = standardTime.getFullYear();
            m = standardTime.getMonth() + 1;
            m = m > 9 ? m : "0" + m;
            d = standardTime.getDate();
            d = d > 9 ? d : "0" + d;
            h = standardTime.getHours();
            h = h > 9 ? h : "0" + h;
            f = standardTime.getMinutes();
            f = f > 9 ? f : "0" + f;
            return y + "." + m + "." + d;
        } else {
            return "暂无";
        }
    },
    baseTimeMMDDFil: function(val) {
        if (val) {
            var standardTime = new Date(Number(val));
            var y, m, d, h, f;
            y = standardTime.getFullYear();
            m = standardTime.getMonth() + 1;
            m = m > 9 ? m : "0" + m;
            d = standardTime.getDate();
            d = d > 9 ? d : "0" + d;
            h = standardTime.getHours();
            h = h > 9 ? h : "0" + h;
            f = standardTime.getMinutes();
            f = f > 9 ? f : "0" + f;
            return `${m}月${d}日`;
        } else {
            return "暂无";
        }
    }
};
export default filter;